package com.ruoyi;

import com.ruoyi.framework.config.properties.SSHConfig;
import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;

/**
 * 启动程序
 * 
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }, scanBasePackages = {"com.ruoyi"})
public class RuoYiApplication
{

    private static void test() throws IOException, TesseractException {
        BufferedImage image= ImageIO.read(new java.io.File("D:\\mywork\\pytorch\\pythonProject\\1512616692101.jpg"));
        String result="";
        Tesseract tesseract = new Tesseract();
        // 设置训练数据文件夹路径
        tesseract.setDatapath("D:\\tessdata");
        // 设置为中文简体
        tesseract.setLanguage("chi_sim");
        try {
            result = tesseract.doOCR(image);
        } catch (Exception e) {
            e.printStackTrace();
            result="";
        }
        System.out.println(result);
    }
    public static void main(String[] args)
    {
        SpringApplication.run(RuoYiApplication.class, args);

        System.out.println("(♥◠‿◠)ﾉﾞ 系统启动成功   ლ(´ڡ`ლ)ﾞ  \n");
    }
}
